*exportols.ado 	JEP		04/29/15
* Program to export results of regressions


*************************** Change log ********************************** 

version 13.1

cap program drop exportols
program exportols
	syntax , name(string) ster(string) ctitle(string) r(string) [register]
	cap assert e(bh_wild)=="."
	if _rc {
		outreg2 using `name', bdec(4) se ctitle(`ctitle') `r' excel keep(treat*) adds(Wild BS P-val , e(tp), LB-Wild, e(bl_wild), UB-Wild, e(bh_wild))
	}
	else {
		outreg2 using `name', bdec(4) se ctitle(`ctitle') `r' excel keep(treat*)  adds(P-val , e(tp))
	}
	est save `ster', replace
	if "`register'"=="register" {
		* project, creates(`name'.xml) preserve
		project, creates(`ster'.ster) preserve
	}
end
